perm filename HOT[AP,SYS]2 blob sn#012208 filedate 1972-11-14 generic text, type T, neo UTF8
COMMENT ⊗   VALID 00003 PAGES 
RECORD PAGE   DESCRIPTION
 00001 00001
 00002 00002	Definitions and storage allocations.
 00003 00003	I can't believe this is the WHOLE program!
 00006 ENDMK
⊗;
;Definitions and storage allocations.

	TITLE	HOT

A←5				;temporary AC
CNT←6				;timer for trying to contact FILER to request hot line

FILER:	SIXBIT	/[-AP-]/	;addressee of the letter requesting the hot line
	OUTLTR			;address of the 32 word letter to be sent to FILER
OUTLTR:	SIXBIT	/HOT/		;signature of sender of letter
INLTR:	BLOCK	=32		;block for receiving a hot line letter from FILER
	ASCIZ	/
?? oops !!
/			;if whole letter is text, this will terminate the OUTSTR
;I can't believe this is the WHOLE program!

HOT:	CALLI	A,30		;PJOB
	MOVEM	A,OUTLTR+1	;put job number into letter requesting hot line
	MOVEI	CNT,=30		;this is how many times we try to contact [-AP-]

RQST:	MAIL	5,FILER		;send letter to [-AP-]
	JRST	PAUSE		;can't send letter now; wait and try again
	JRST	SUCCES		;letter successfully sent.  wait for letter from FILER
GIVEUP:	OUTSTR	[ASCIZ /

Cannot run hot line now--sorry.

/]
	CALLI	12		;EXIT

PAUSE:	SOJLE	CNT,GIVEUP	;if have tried unsuccessfully for a long time, give up
	MOVEI	A,1		;sleep a second and then try again
	CALLI	A,31		;SLEEP
	JRST	RQST

SUCCES:	OUTSTR	[ASCIZ /

...Associated Press news...

/]
	JRST	GETLTR

PRINT:	OUTSTR	INLTR		;type out latest letter
GETLTR:	WRCV	INLTR		;get a letter from [-AP-],
	MOVE	A,INLTR		;load first word of letter
	AOJN	A,PRINT		;-1 in first word means FILER is dying, will restart

DYING:	OUTSTR	[ASCIZ /
...one moment please.../]
	MOVEI	A,=20		;this is how long we give FILER to start up again
	CALLI	A,31		;SLEEP
	JRST	HOT

	END	HOT